<?php if(!defined('IN_PISCES')){exit('Access Denied.');}?>
<script language="javascript" type="text/javascript">
function doLogin(){
	$('#spLoginInfo').html('');
	var username	= $('#txtUsername').val();
	var password	= $('#txtPassword').val();
	var loginUrl	= $('#hdLoginUrl').val();

	if(username=="" || password=="")
	{
		return;
	}
	
	$('#spLoginInfo').html('正在登录...');
	
	$.ajax({
	    url: loginUrl,
	    type: 'POST',
	    data:{'username':username,'password':password,'rnum':Math.random()},
	    dataType: 'json',
	    success: function(res){
			if(res.code<=0){
				$('#spLoginInfo').html('登录失败，请检查你的输入！');
			}else{
				document.location	= res.data.forward;
			}
		},
		error:function(res){
			alert(res.responseText);
		}
	});
}
</script>
<div class="left" id="content">
  <div id="con">
      <div id="banner">
        
        {if !empty($this->data['adList']) && !empty($this->data['adList'][29])}
          <div id="bannercontent">
            <!--{loop $this->data['adList'][29] $mk $item}-->
            {if $mk<=6}
            <div {if $mk==0}{else} class="smask"{/if}> {$item['code']} </div>
            {/if}
            <!--{/loop}--> 
          </div>
          <ul id="bannernav">
          <!--{loop $this->data['adList'][29] $mk $item}-->
          {if $mk<=6}
          <li >{$mk}</li>
          {/if}
           <!--{/loop}-->
           </ul>       
           {else}
          <div id="bannercontent">
          <div><div style="margin:20px 0 0 50px; width:300px;">请在Flash专用广告增加六个广告模块.</div></div>
          {if $this->data['return']['rate']>0}<div class="smask"><img src="{$this->data['baseurl']}images/flow.png" /></div>{/if}
          <div><div style="margin:20px 0 0 50px; width:300px;">广告位招租</div></div>
          </div>
          <ul id="bannernav">
          <li></li>
          <li></li>
          <li></li>
          </ul>
           {/if}
  </div>
  <!-- #banner --> 
</div>
</div>
<!-- #content -->
<div class="right" id="side">
  <div id="login"> {component frontend login} <!--#登录标签--> 
  </div>
  <!-- #通告 --> 
</div>
<!-- #side--> 
{if !empty($this->data['adList']) && !empty($this->data['adList'][4])} 
<div class="clear"></div>
<!--{loop $this->data['adList'][4] $mk $item}-->
{if $mk<=1}
<div class="adbox"> {$item['code']} </div>
{/if}
<!--{/loop}--> 
{/if}
<div class="clear"></div>
<div class="cataBrand mt15">
  <div class="hpcata left mr10 bor1">
    <div class="hcata-title clearfix mb5"><a class="fr morelink mt5 pr10" href="{url('Default','Sitemap')}" target="_blank" title="分类导航">查看所有分类</a>
      <h2 class="fl mt10 pl10 f14">商品分类</h2>
    </div>
{component frontend hotkey}
    <div class="hcatabox clearfix">
      <h3 class="hcatabox-t fl mr5 f12"><a href="{url('Default','Hot')}" class="link1">热门</a></h3>
      <div class="fl hcatabox-df">
        <ul class="hcalist clearfix">
{HotKeyList(array(),'id DESC',0,30)}
    {if !empty($pvHotKeyList['rows'])} 
    <!--{loop $pvHotKeyList['rows'] $k $item}-->
    <li {if $k==30}class="li-end"{/if}><a href="{url('Default','List',array('k'=>$item['name']))}" title="{$item['name']}" target="_blank">{$item['name']}</a> </li>
    <!--{/loop}--> 
    {/if}
        </ul>
      </div>
    </div>    
  </div>
  <div class="right hbrand bor1">
  {TagList(array(),'id ASC',0,20,'id,name')}
          {if !empty($pvTagList['rows'])}
  <div class="tag">
  <h4 class="tag-title" title="Tag">相关标签</h4>
  <ul class="tag-list tag-list-icons">
          <!--{loop $pvTagList['rows'] $item}--> 
          {if $this->data['tag_id']==$item['id']}<li class="tag-list-item"> <a title="{$item['name']}"> {$item['name']}</a></li>{else}<li class="tag-list-item"><a href="{url('Post','List',array('tag'=>$item['id']))}" title="{$item['name']}">{$item['name']}</a></li>{/if} 
          <!--{/loop}--> 
  </ul>
  <p class="tag-line"></p>
</div>
<div class="clear"></div>
  {/if}
  {RecentView(6,array('num_iid','title','pic_url'),3600)}
{if !empty($pvRecentViewList)}
    <div class="clearfix">
      <h2 class="fl hot-title pl10">最新浏览</h2>
    </div>
    <ul class="clearfix hblist">
	<!--{loop $pvRecentViewList $k $item}-->
	<li><a href="{url('Default','View',array('id'=>$this->data['cf']->getId($item['num_iid'])))}" title="{strip_tags($item['title'])}" target="_blank"><img alt="{strip_tags($item['title'])}" src="{$this->data['baseurl']}images/loading.gif" u="{EncodeImg $item['pic_url']}_b.{$this->data['cf']->getFileExt($item['pic_url'])}" /></a></li>
	<!--{/loop}-->
    </ul>
 <div class="clear"></div>
    {/if}
{PostList(array('type'=>1,'status'=>1),'last_updated DESC',0,5,'id,title',3600,'site_right')}
{if !empty($pvPostList['rows'])}
<div class="bbs_zx">
  <div class="tit tit_right">
    <h2>最新动态</h2>
  </div>
  <ul>
	<!--{loop $pvPostList['rows'] $k $item}-->
	<li {if $k<3}class="red"{else}class=""{/if}><span>·</span><a href="{url('Post','View',array('id'=>$item['id']))}" title="{$item['title']}" target="_blank">{$item['title']}</a></li>
	<!--{/loop}-->
  </ul>
</div>
<div class="clear"></div>
{/if}    
  </div>
</div>
<div class="clear"></div>
{if !empty($this->data['adList']) && !empty($this->data['adList'][4])} 
<!--{loop $this->data['adList'][4] $mk $item}-->
{if $mk>1}
<div class="adbox"> {$item['code']} </div>
{/if}
<!--{/loop}-->
{/if}
{if $this->data['moduleList']}
<div class="clear"></div>
<!--{loop $this->data['moduleList'] $module}-->
{if $module['info']['mode']==0}
{ProductList($module['info']['con'],array('pic_url,num_iid,title,price'),$module['info']['updateperiod']*3600,'site_index')}
	{if !empty($pvProductList)}

<div class="content_wrap">
    <div class="guide_msg">
      <h3>{$module['info']['name']}</h3>
      <p>同步线下1个月内当季最热销</p>
    </div>
    <div class="sliding_tab_wrap">
      <div id="hd_1" class="hd">
        <ul>
          {if $module['info']['otherkeyword']}
<!--{loop $module['info']['otherkeyword'] $key $keyword}-->
<li><a target="_blank" href="{url('Default','List',array('c'=>$module['info']['con']['cid'],'k'=>$keyword))}">{$keyword}</a></li>
<!--{/loop}-->
			{/if}
        </ul>
        <div class="link_more_area"> {if $module['info']['link']!=''}<a href="{$module['info']['link']}" title="更多的{$module['info']['name']}" target="_blank">查看更多</a>{/if}
      </div>
      </div>
      <div class="bd"> 
        <ul class="list_area">
        <!--{loop $pvProductList $mk $item}-->
          <li onMouseOver="this.className='bg_hover';" onMouseOut="this.className='bg_normal'" class="bg_normal"> <a target="_blank"  title="{strip_tags($item['title'])}" href="{url('Default','View',array('id'=>$this->data['cf']->getId($item['num_iid'])))}" class="img_wrap"><img alt="{strip_tags($item['title'])}" src="{$this->data['baseurl']}images/loading.gif" u="{EncodeImg $item['pic_url']}_b.{$this->data['cf']->getFileExt($item['pic_url'])}"><strong>{strip_tags($item['title'])}</strong></a>
            <p class="made_time"></p>
            <p class="price"><strong>商城价：<span>￥{strip_tags($item['price'])}</span></strong></p>
            <p class="link_wrap"> {if $this->data['return']['rate']>0 && round($item['commission']*$this->data['return']['rate']/100,2)>0}返现:<span class="g_yuan">¥</span>{round($item['commission']*$this->data['return']['rate']/100,2)}{/if}</p>
            <p class="recommander_link"> <span class="instant_buy"> <a target="_blank" linktype="click-url" href="#" nid="{$item['num_iid']}"  class="instant_buy_btn">立即购买</a> </span> <a target="_blank" href="{url('Default','View',array('id'=>$this->data['cf']->getId($item['num_iid'])))}" class="recommander_me">查看详情&gt;&gt;</a> </p></li>
         <!--{/loop}-->
        </ul>
      </div>
    </div>
</div>
{/if}
{/if}
<!--{/loop}-->
<div class="clear"></div>
{/if}
{if !empty($this->data['adList']) && !empty($this->data['adList'][5])}
<div class="clear"></div>
<!--{loop $this->data['adList'][5] $mk $item}-->
{if $mk<=1}
<div class="adbox"> {$item['code']} </div>
{/if}
<!--{/loop}-->
{/if}
{if $this->data['moduleList']}
<div class="clear"></div>
<div class="clearfix mt15">
<!--{loop $this->data['moduleList'] $module}-->
{if $module['info']['mode']==1}
{ProductList($module['info']['con'],array('pic_url,num_iid,title,price'),$module['info']['updateperiod']*3600,'site_index')}
	{if !empty($pvProductList)}

  <div class="left m2box">
    <div class="hd">
      <div class="contitle relative clearfix">
        <h2 class="fl pl15">{$module['info']['name']}</h2>
        <ul class="subnav fr">
{if $module['info']['otherkeyword']}
<!--{loop $module['info']['otherkeyword'] $key $keyword}-->
<li><a target="_blank" href="{url('Default','List',array('c'=>$module['info']['con']['cid'],'k'=>$keyword))}">{$keyword}</a></li>
<!--{/loop}-->
			{/if}
     {if $module['info']['link']!=''}<li><a href="{$module['info']['link']}" title="更多的{$module['info']['name']}" target="_blank">more</a></li>{/if}
        </ul>
      </div>
    </div>
    <div class="bd">
      <div class="boxlist clearfix">
        <ul class="m2list clearfix">
          
      <!--{loop $pvProductList $mk $item}-->
        <li><a title="{strip_tags($item['title'])}" href="{url('Default','View',array('id'=>$this->data['cf']->getId($item['num_iid'])))}" target="_blank"><img alt="{strip_tags($item['title'])}" src="{$this->data['baseurl']}images/loading.gif" u="{EncodeImg $item['pic_url']}_b.{$this->data['cf']->getFileExt($item['pic_url'])}"><span class="title block">{strip_tags($item['title'])}</span><span class="block price">￥{strip_tags($item['price'])}</span></a></li>
        <!--{/loop}-->

        </ul>
      </div>
    </div>
  </div>
{/if}
{/if}
<!--{/loop}-->
</div>
{/if}
{if !empty($this->data['adList']) && !empty($this->data['adList'][5])}
<div class="clear"></div>
<!--{loop $this->data['adList'][5] $mk $item}-->
{if $mk>1}
<div class="adbox"> {$item['code']} </div>
{/if}
<!--{/loop}--> 
{/if}
{PostList(array('type'=>2,'status'=>1),'suggest DESC,last_updated DESC',0,21,'id,username,title,content',3600,'site_index')}
      {if !empty($pvPostList)}
      <div class="clear"></div>
<div class="bbs_fx">
  <div class="mt15 clearfix">
    <div class="comments fx_main fl clearfix">
      <div class="hd">
        <div class="clearfix title"> <a href="{url('Post','List')}" class="fr mr10">查看更多</a>
          <h3 class="pl15 fb">会员分享</h3>
        </div>
      </div>
      <div class="bd">
      <!--{loop $pvPostList['rows'] $k $item}-->
        <dl>
          <dt><a href="{url('Post','View',array('id'=>$item['id']))}" title="{$item['title']}" target="_blank"><img src="{$this->data['baseurl']}images/loading.gif" u="{if $item['content']['product']['image']}{EncodeImg $item['content']['product']['image']}{else}{EncodeImg $this->data['baseurl'].'images/avatar-120.png'}{/if}" alt="{$item['title']}" class="s50"></a></dt>
          <dd class="lower comuser">{$item['username']}</dd>
          <dd class="contxt"><a href="{url('Post','View',array('id'=>$item['id']))}" title="{$item['content']}" target="_blank">{$item['title']}</a></dd>
        </dl>
        <!--{/loop}-->
      </div>
    </div>
    <div class="fx_ad fr">
    {if !empty($this->data['adList']) && !empty($this->data['adList'][3])}
    <div class="adbox">
	<!--{loop $this->data['adList'][3] $mk $item}-->
	<div class="mb5">
	{$item['code']}
	</div>
	<!--{/loop}-->
    </div>
	 {/if}
    </div>
  </div>
</div>
{/if}
<div class="clear"></div>
<div class="top_part day_follow">
  <div class="hd">
    <h3>每日<strong>关注</strong>商品</h3>
    <i class="icon_line"></i> </div>
  <div class="bd"> 
    <div class="tab_cont"> 
      <ul class="tab_item" style="visibility: visible;">
      	{HotView(10,array('num_iid','title','pic_url','price'),3600)}
		{if !empty($pvRecentViewList)}
		<!--{loop $pvRecentViewList $k $item}-->
        {if $k==0}
        <li class="on"> <span class="order order_{$k+1}">{$k+1}</span> <a class="img_wrap" href="{url('Default','View',array('id'=>$this->data['cf']->getId($item['num_iid'])))}" target="_blank" title="{$item['title']}"><img src="{$this->data['baseurl']}images/loading.gif" u="{EncodeImg $item['pic_url']}_b.{$this->data['cf']->getFileExt($item['pic_url'])}"></a>
          <div class="img_detail">
            <div class="name_wrap"> <a class="name" href="{url('Default','View',array('id'=>$this->data['cf']->getId($item['num_iid'])))}" target="_blank">{$item['title']}</a></div>
            <p class="price"><span class="shop_price">¥{$item['price']}</span></p>
            <p style="visibility:hidden;" class="grade_wrap"><i class="grade_bg"><i style="width:80%" class="grade">&nbsp;</i></i> </p>
            <p class="btn_wrap"><a class="btn" linktype="click-url" href="#" nid="{$item['num_iid']}"  target="_blank">立即购买</a></p>
          </div>
        </li>
        {else}
        <li > <span class="order order_{$k+1}">{$k+1}</span> 
        <div class="img_detail">
            <div class="name_wrap"> <a class="name" href="{url('Default','View',array('id'=>$this->data['cf']->getId($item['num_iid'])))}" target="_blank">{$item['title']}</a><span class="amount"><span class="co_red"><a class="btn" linktype="click-url" href="#" nid="{$item['num_iid']}"  target="_blank">去购买</a></span></span></div>
          </div>
        </li>
        {/if}
       <!--{/loop}-->
		{/if}
      </ul>
    </div>
  </div>
</div>
<div class="top_part day_follow">
  <div class="hd">
    <h3>每日<strong>热门</strong>商品</h3>
    <i class="icon_line"></i> </div>
  <div class="bd"> 
    <div id="dayFollowCont" class="tab_cont"> 
      <ul id="attention_good" class="tab_item" style="visibility: visible;">
      	{HotClick(10,array('num_iid','title','pic_url','price'),3600)}
		{if !empty($pvRecentViewList)}
		<!--{loop $pvRecentViewList $k $item}-->
        {if $k==0}
        <li class="on"> <span class="order order_{$k+1}">{$k+1}</span> <a class="img_wrap" href="{url('Default','View',array('id'=>$this->data['cf']->getId($item['num_iid'])))}" target="_blank" title="{$item['title']}"><img src="{$this->data['baseurl']}images/loading.gif" u="{EncodeImg $item['pic_url']}_b.{$this->data['cf']->getFileExt($item['pic_url'])}"></a>
          <div class="img_detail">
            <div class="name_wrap"> <a class="name" href="{url('Default','View',array('id'=>$this->data['cf']->getId($item['num_iid'])))}" target="_blank">{$item['title']}</a></div>
            <p class="price"><span class="shop_price">¥{$item['price']}</span></p>
            <p style="visibility:hidden;" class="grade_wrap"><i class="grade_bg"><i style="width:80%" class="grade">&nbsp;</i></i> </p>
            <p class="btn_wrap"><a class="btn" linktype="click-url" href="#" nid="{$item['num_iid']}"  target="_blank">立即购买</a></p>
          </div>
        </li>
        {else}
        <li > <span class="order order_{$k+1}">{$k+1}</span> 
        <div class="img_detail">
            <div class="name_wrap"> <a class="name" href="{url('Default','View',array('id'=>$this->data['cf']->getId($item['num_iid'])))}" target="_blank">{$item['title']}</a><span class="amount"><span class="co_red"><a class="btn" linktype="click-url" href="#" nid="{$item['num_iid']}"  target="_blank">去购买</a></span></span></div>
          </div>
        </li>
        {/if}
       <!--{/loop}-->
		{/if}
      </ul>
    </div>
  </div>
</div>
<div class="clear"></div>
{component frontend link}
<script language="javascript">
var defaultClickUrl	= "{$this->data['clickUrl']}";
replaceLink();
replaceImage();
</script>
<script language="javascript">
{if !$this->data['user']}
document.onkeydown=function(event)
{
	if(event==null)
	{
		event	= window.event;
	}
	if(event.keyCode==13) 
	{ 
		doLogin();
	} 
}
{/if}
</script>